<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="libs/jquery-1.11.0.js"></script>
		<script type="text/javascript" src="pub/JSCommonUtil.js"></script>
		<title>repeat测试</title>
	</head>


	<body>
		<h2>简单repeat 测试</h2>
		<div id="father1">
		</div>
		<h2>复杂点的repeat测试</h2>		
		<div id="father2"></div>
		<h2>repeat自带 $index 的复杂点的应用</h2>
		<div id="father3"></div>
		

		<h2>repeat里面取值 整个数据  $data做运算</h2>
		<div id="father4"></div>

		<h2>repeat迭代运算</h2>
		<div id="father5"></div>

		<h2>repeat $index 随着数据变化</h2>
		<div id='father6'></div>
		<h2>repeat jc-duplex jc-bind 混合测试</h2>
		<div id="father7"></div>
		<script type="text/javascript">
		var session={};
		$(function(){
			jc.render({a:[1,2,3]},"test_repeat",$('#father1'),function(){
				console.log("OK");
			})
			var data2={
				a:[
					{
						a:"a1",
						b:"b1"
					},
					{
						a:"a2",
						b:"b2"
					},
					{
						a:"a3",
						b:"b3"
					}
				]
			}
			jc.render(data2,"test_repeat2",$('#father2'),function(){
				console.log("复杂的测试OK")
			})
			var data3={elem:[1,2,3,4]}
			jc.render(data3,"test_repeat1",$('#father3'),function(){
				console.log("father3 ok")
			})
			var data4={elem:[1,2],c:"b"}
			jc.render(data4,"test_repeat3",$('#father4'),function(){
				console.log("father4 ok")
			})

			var data5 ={
				a1:[
					{
						a2:[
							{k:"k1",v:"v1"},
							{k:"k2",v:"v2"},
							{k:"k3",v:"v3"}
						],
						k2:"值1"
					},
					{
						a2:[
							{k:"k.1",v:"v1"},
							{k:"k.2",v:"v2"},
							{k:"k.3",v:"v3"}
						],
						k2:"值2"
					}
				],
				a11:[
					{
						a2:[1,2,3,4]
					}
				]
			}
			jc.render(data5,"test_repeat4",$('#father5'),function(){
				console.log("father5 ok")
			})
			var data6 = {elems:[
							{k:"k1",v:"v1"},
							{k:"k2",v:"v2"},
							{k:"k3",v:"v3"}
						]};
			jc.render(data6,"test_repeat5",$('#father6'),function(){
				console.log("father6 ok")
			})
			var data7 = {
				forms:[
					{b:"bind1",d:"duplex-1"},
					{b:"bind2",d:"duplex-2"},
					{b:"bind3",d:"duplex-3"}
				]
			}
			jc.render(data7,"test_repeat6",$("#father7"),function(){
				console.log("father7 ok")
			})

		})
		</script>
	</body>
</html>